# 贝尔实验室 Spring 官方推荐镜像 JDK下载地址 https://bell-sw.com/pages/downloads/
FROM bellsoft/liberica-openjdk-debian:17.0.11-cds

LABEL maintainer="sakura"

RUN mkdir -p /sakura/server/logs \
    /sakura/server/temp \
    /sakura/skywalking/agent

WORKDIR /sakura/server

ENV SERVER_PORT=80 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" \
    OSS_ACCESS_KEY=${OSS_ACCESS_KEY} \
    OSS_SECRET_KEY=${OSS_SECRET_KEY}

EXPOSE ${SERVER_PORT}

ADD ./sakura-oj-api.jar ./app.jar

ENTRYPOINT java -Dserver.port=${SERVER_PORT} \
          -DOSS_ACCESS_KEY=${OSS_ACCESS_KEY} \
          -DOSS_SECRET_KEY=${OSS_SECRET_KEY} \
          -XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
          -jar app.jar

